package edu.kit.aifb.ruleintegrator.rule.metric;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

public abstract class AbstractFunction implements Function {

	
	public abstract double measure(String attr1, String attr2) ;

	
	public abstract String getName();
	
	@Override
	public int hashCode() {
		return new HashCodeBuilder(11,31).append(this.getName()).toHashCode();
		
	}

	@Override
	public boolean equals(Object obj) {
		 if (obj == null) { return false; }
		   if (obj == this) { return true; }
		   if (obj.getClass() != getClass()) {
		     return false;
		   }
		   AbstractFunction rhs = (AbstractFunction) obj;
		   return new EqualsBuilder()
		                 .append(this.getName(), rhs.getName())
		                 .isEquals();
	}
	

}
